<template>
	<view class="">
        <view class="top">
             <u-search placeholder="搜索" search-icon-color="blue" v-model="total" border-color="black" @custom="searching()" @search="searching()" showAction="false"></u-search>
        </view>         
               <uni-section title="按范围分" type="line">
                    <view class="uni-px-5">
                        <uni-data-checkbox mode="tag" v-model="title" :localdata="titles"></uni-data-checkbox>
                    </view>
                </uni-section>   
                       
                 
            	<uni-section title="按分类分" type="line">
            			<view class="uni-px-5">
            				<uni-data-checkbox style="transform: scale(0.7);" mode="tag" v-model="radio" :localdata="type" @change="searching()"></uni-data-checkbox>
            			</view>
            	</uni-section>   
                    
                    
                   <uni-section title="按时间分" type="line">
                  				  		<view class="uni-px-5">
                  				  			<uni-data-checkbox style="transform: scale(0.7);" mode="tag" v-model="ttime" @change="searching()" :localdata="types"></uni-data-checkbox>
                  				  		</view>
                  				  </uni-section>  
                    
                    
                    
             <Iidd  v-for="item in iidds" :key="item.id" :di="item" @tap="dt(item)"></Iidd>
 
	   
	</view>
</template>

<script>
     import Iidd from '@/components/iidd.vue'
	export default {
        components:{
            Iidd
        },
		data() {
			return {
                total:'',
                hou:{
                    biaoti:"",
                    ztext:"",
                    komg:"",
                    ctime:""
                },
                iidds:[],
                title:0,
                titles: [{
                            text: '标题搜索',
                            value: 0
                        }, {
                            text: '全文搜索',
                            value: 1,
                        }
                        ],
                radio: 2,
                type: [{
                            text: '联动要闻',
                            value: 2
                        }, {
                            text: '融媒视野',
                            value: 3,
                        }, {
                            text: '工作动态',
                            value: 4
                        }, {
                            text: '辟谣访谈',
                            value: 5
                        }, {
                            text: '热点专题',
                            value: 6
                        }
                        ],
                        ttime:7,
                        						types: [{
                        						            text: '一天以内',
                        						            value: 1
                        						        }, {
                        						            text: '一周以内',
                        						            value: 7,
                        						        }, {
                        						            text: '一个月以内',
                        						            value: 30
                        						        }
                        						        ],
			}
		},
		onLoad(options) {
			
		},
        created() {
           this.initialize()
        },
		methods: {
            initialize(){
                if(this.title!==0){
                    if(this.total!=="" && this.total!==null){
                         this.hou.ztext=this.total
                       
                    }
                }else{
                    if(this.total!=="" && this.total!==null){
                         this.hou.biaoti=this.total
                    }
                }
                this.hou.ctime=this.ttime
                  this.hou.komg=this.radio
                  console.log(this.hou)
                this.request("/hou/byall", 'POST',this.hou).then((res) => {
                    this.iidds=res.data.data
                    this.hou={}
                })
            },
           searching(){
               this.initialize()
           }
		}
	}
</script>

<style>
    	.text {
    		font-size: 12px;
    		color: #666;
    		margin-top: 5px;
    	}
    	.uni-px-5 {
    	    padding-left: 10px;
    	    padding-right: 10px;
    	}
    	.uni-pb-5 {
    	    padding-bottom: 10px;
    	}
     .top{
         margin-top: 20px;
         width: 95%;
         padding-left: 2.5%;
     }
</style>
